Conflicting Facts
Conflicting facts can occur for a variety of reasons, including violation of first, second, or third normal forms. An example of conflicting facts occurring through a violation of second normal form is shown in the following figure:
The following two tables are sample instance tables showing “emp‑spouse‑address”:
EMPLOYEE
emp-id |
emp-name |
emp-address |
E1 |
Tom |
Berkeley |
E2 |
Don |
Berkeley |
E3 |
Bob |
Princeton |
E4 |
Carol |
Berkeley |
CHILD
emp-id |
child-id |
child-name |
emp-spouse-address |
E1 |
C1 |
Jane |
Berkeley |
E2 |
C1 |
Tom |
Berkeley |
E2 |
C2 |
Dick |
Berkeley |
E2 |
C3 |
Donna |
Cleveland |
E4 |
C1 |
Lisa |
New York |
The attribute named “emp-spouse-address” is included in CHILD, but this design is a second normal form error. The instance data highlights the error. As you can see, Don is the parent of Tom, Dick, and Donna but the instance data shows two different addresses recorded for Don's spouse. Perhaps Don has had two spouses (one in Berkeley, and one in Cleveland), or Donna has a different mother from Tom and Dick. Or perhaps Don has one spouse with addresses in both Berkeley and Cleveland. Which is the correct answer? There is no way to know from the model as it stands. Business users are the only source that can eliminate this type of semantic problem, so analysts need to ask the right questions about the business to uncover the correct design.
The problem in the example is that “emp-spouse-address”is a fact about the EMPLOYEE's SPOUSE, not about the CHILD. If you leave the structure the way it is now, then every time Don's spouse changes address (presumably along with Don), you will have to update that fact in multiple places; once in each CHILD instance where Don is the parent. If you have to update multiple places, you might miss some and get errors.
Once it is recognized that “emp-spouse-address” is a fact not about a child, but about a spouse, you can correct the problem. To capture this information, you can add a SPOUSE entity to the model, as shown in the following figure:
The following three tables are sample instance tables reflecting the SPOUSE Entity:
EMPLOYEE
emp-id |
emp-name |
emp-address |
E1 |
Tom |
Berkeley |
E2 |
Don |
Berkeley |
E3 |
Bob |
Princeton |
E4 |
Carol |
Berkeley |
CHILD
emp-id |
child-id |
child-name |
E1 |
C1 |
Jane |
E2 |
C1 |
Tom |
E2 |
C2 |
Dick |
E2 |
C3 |
Donna |
E4 |
C1 |
Lisa |
SPOUSE
emp-id |
spouse-id |
spouse-address |
current-spouse |
E2 |
S1 |
Berkeley |
Y |
E2 |
S2 |
Cleveland |
N |
E3 |
S1 |
Princeton |
Y |
E4 |
S1 |
New York |
Y |
E5 |
S1 |
Berkeley |
Y |
In breaking out SPOUSE into a separate entity, you can see that the data for the address of Don's spouses is correct. Don has two spouses, one current and one former.
By making sure that every attribute in an entity carries a fact about that entity, you can generally be sure that a model is in at least second normal form. Further transforming a model into third normal form generally reduces the likelihood that the database will become corrupt; in other words, that it will contain conflicting information or that required information will be missing.
Copyright © 2025 Quest Software, Inc. |